<label>Customer: </lable> <%= Customer.find(@bill.customer_id).name %>
<label>Electerician: </lable> <%= Electrician.find(@bill.electrician_id).name %>
<label>Date  </lable> <%= @bill.sold_date %>

<table id='billTable'>
  <tr>
    <th>Name</th>
    <th>Company</th>
    <th>Sale cost</th>
    <th>Quantity</th>
    <th>Total</th>
  </tr>
    <%  Sold.find_all_by_ref_id(@bill.ref_id).each do |sold| %>
      <tr>
        <td> <%= sold.stock().name %> </td>
        <td> <%= sold.stock().company %> </td>
        <td> <%= sold.cost %> </td>
        <td> <%= sold.quantity %> </td>
        <td> <%= sold.quantity * sold.cost %> </td>
    <% end %>
</table>
<h3><label>Total: </label> <%= @bill.grand_total%></h3>
